import Vue from 'vue'
import VueRouter from 'vue-router'
// import Home from '../views/home'
// import Cart from '../views/cart'
const Home = () => import('../views/home')
const Cart = () => import('../views/cart')
Vue.use(VueRouter)

const routes = [{
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    component: Home
  },
  // 购物车列表
  {
    path: '/cart',
    component: Cart
  }
]
const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
